<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'
import socket from './socket'
export default {
  name: 'App',
  data() {
    return {
      user: {
        name: 'lucio',
        age: 18
      },
      msg: ''  
    }
  },
  components: {
    HelloWorld
  },
  created() {
    this.hello()
  },
  methods: {
    hello() {
      socket.emit('sayHello', this.user, (res) => {
        console.log(res);
        this.msg = res;
      })
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
</style>
